package cn.itfenxiang.roadlawbuddha_back.service.impl;

import cn.itfenxiang.roadlawbuddha_back.config.EmailProperties;
import cn.itfenxiang.roadlawbuddha_back.service.EmailService;
import cn.itfenxiang.roadlawbuddha_back.utils.MailUtil;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class EmailServiceImpl implements EmailService {

    @Resource
    private EmailProperties emailProperties;

    /**
     *
     * @param to
     * @param title
     * @param content
     * @return
     */
    @Override
    public boolean send(String to, String title, String content) {
        //打印email配置信息
        System.out.println(emailProperties);
        //发送邮件
       return MailUtil.sendMail(emailProperties, to, title, content);
    }
}
